<html>
<head>
<head>
<script type="text/javascript">
	Ext.apply(Ext.form.VTypes, {
		ipVal: /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])/,
		ipMask: /[0-9.]/,
		ipText: '非法ip列表',
		ip: function(v) {
			return this.ipVal.test(v);
		}
	});
	Ext.onReady(function(){
		 var <?php echo $name ?>Panel = new Ext.FormPanel({
                id:'',
                iconCls:'icon-docs',
                autoScroll: true,
        labelWidth: 100, // label settings here cascade unless overridden
        url:'whiteList/<?php echo $name ?>',
        frame:true,
        title: '提交服务需求',
        bodyStyle:'padding:5px 5px 0',
        width: 700,
        defaultType: 'textfield',

        items: [{
                fieldLabel:'产品线名称',
                name: 'productName',
                allowBlank:false,
		blankText:'产品线不允许为空'
            },
            {
                fieldLabel: '期望完成时间',
                name: 'expectedTime',
                xtype: 'datetimefield'
            },{
		fieldLabel: '抄送邮箱',
                width:570,
                emptyText:'多个邮箱分号分隔'
	    },{
		fieldLabel:'IP列表',
		xtype: 'textarea',
		vtype:'ip',
                allowBlank:false,
		emptyText:'一行一个IP,不用逗号分隔\nFor Example:\n127.0.0.1\n127.0.0.2',
		name: 'description',
		hideLabel: false,
		height: 200,
		anchor: '100%'
	    },{
		fieldLabel:'备注',
		xtype: 'textarea',
                allowBlank:true,
		emptyText:'特殊需求、附加内容,可以不填',
		name: 'remark',
		hideLabel: false,
		height: 200,
		anchor: '100%'
	    },{
		xtype:'hidden',
		name:'service',
		value:'<?php echo $name ?>'
	    }   
        ],
        buttons: [{
            text: 'Save',
            handler:function(){ 
                <?php echo $name ?>Panel.getForm().submit({
                        success: function(form, action){
                        Ext.Msg.alert('Success', 'It worked');
                },
                failure: function(form, action){
                        Ext.Msg.alert('Warning', 'Error');
                }       
                });
            }
        },{
            text: 'reset',
            handler:function(){
                <?php echo $name ?>Panel.getForm().reset();
            }
        }]
                });
		<?php echo $name ?>Panel.render("<?php echo $name ?>");
	});
</script>

<body>
<div id="<?php echo $name ?>"></div>
</body>
</html>
